package com.aijia.custom.product.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.aijia.custom.product.data.WSheetData;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yejianjun on 2019/1/18.
 */

public class WSheetDetailAdapter extends BaseAdapter {

    private Context mContext;
    private List<WSheetData> mList = new ArrayList<>();

    public WSheetDetailAdapter(Context context) {
        mContext = context;
    }


    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public Object getItem(int position) {
        return mList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Holder holder;
        if (null == convertView) {
            holder = new Holder();
            /*convertView = mInflater.inflate(R.layout.wsheet_detail_item, null);
            holder.nameTV = convertView.findViewById(R.id.wsheet_detail_item_name);
            holder.statusTV = convertView.findViewById(R.id.wsheet_detail_item_status);
            holder.createDateTV = convertView.findViewById(R.id.wsheet_detail_item_createDate);
            holder.finishDateTV = convertView.findViewById(R.id.wsheet_detail_item_finishDate);
            holder.contentTV = convertView.findViewById(R.id.wsheet_detail_item_content);*/
            LayoutInflater mInflater = LayoutInflater.from(mContext);
            convertView.setTag(holder);
        } else {
            holder = (Holder) convertView.getTag();
        }


        return convertView;
    }

    class Holder {
        public TextView nameTV;
        public TextView statusTV;
        public TextView createDateTV;
        public TextView finishDateTV;
        public TextView contentTV;
    }

}
